Printing apparatus and method of controlling printing apparatus

ABSTRACT

A printing apparatus includes a carriage that moves in a direction crossing the conveyance direction of a print sheet, and a sheet edge detection sensor disposed on the carriage and having an LED and a phototransistor. The printing apparatus adjusts at least one of an LED driving circuit and an amplification circuit such that an output from the amplification circuit when LED emits light to a predetermined position on the print sheet is at a predetermined level. Also, after this adjustment but before detection of a sheet edge by the sheet edge detection sensor, the printing apparatus controls an extra-printing amount by which printing extends off the sheet edge based on an output from the amplification circuit.

BACKGROUND OF THE INVENTION Field of the Invention

The present invention relates to a printing apparatus and a method ofcontrolling a printing apparatus.

Description of the Related Art

Among printing apparatuses, there are apparatuses that detect thepositions of edges of a print sheet and minimize the amount of ink to beejected to the outside of the print sheet, for reduction of the amountof ink consumption in borderless printing, lengthening of the life of awaste ink collection mechanism, and so on.

Japanese Patent Laid-Open No. 2000-109243 discloses a printing apparatushaving a carriage unit equipped with a reflection-type optical sensorcapable of detecting the positions of edges of a print sheet. Thisprinting apparatus detects the positions of edges of a sheet with thesensor during printing of an image onto the sheet using a head mountedon the carriage unit. Also, in consideration of the variation in sensorcharacteristics, the variation in attachment position, and the like,this printing apparatus adjusts the amount of light to be emitted suchthat a target output level can be obtained from a light receiving unitof the reflection-type optical sensor while the sensor is above theprint sheet. This adjustment of the amount of light to be emitted isperformed prior to the printing operation, during which the sheet edgedetection is actually performed.

Here, ambient light may get in through a sheet discharge port or thelike and the light receiving unit of the sensor may receive the ambientlight as well as light from a light emitting unit. Thus, the amount ofambient light may be different between when the amount of light to beemitted is adjusted and when the printing operation is performed withthe sheet edge detection. This may deteriorate the accuracy of the sheetedge detection. Consequently, the printing start position and theprinting end position at the sheet edges may be shifted, leading to afailure to print the desired image.

SUMMARY OF THE INVENTION

A printing apparatus according to an aspect of the present inventionincludes: a carriage configured to move in a direction crossing aconveyance direction of a print sheet; a detection unit disposed on thecarriage and having a light emitting unit for emitting light and a lightreceiving unit for making an output according to received light, thedetection unit being configured to detect a sheet edge of the printsheet based on the output from the light receiving unit when the lightemitting unit emits light to the print sheet; an adjustment unitconfigured to adjust at least one of an amount of light to be emittedfrom the light emitting unit and the output from the light receivingunit such that the output from the light receiving unit when the lightemitting unit emits light to a predetermined position on the print sheetis at a predetermined level; and a control unit configured to control anextra-printing amount by which printing extends off the sheet edge,after the adjustment by the adjustment unit but before the detection ofthe sheet edge by the detection unit, based on the output from the lightreceiving unit.

Further features of the present invention will become apparent from thefollowing description of exemplary embodiments with reference to theattached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram of an internal configuration of a printingapparatus;

FIG. 2 is a diagram illustrating a configuration of a print head;

FIG. 3 is a diagram illustrating a block configuration of a controlsystem in the printing apparatus;

FIG. 4 is a side view for explaining an arrangement of optical elementsof a sheet edge detection sensor;

FIG. 5 is a diagram illustrating an example flowchart of processing inborderless printing;

FIGS. 6A and 6B are flowcharts illustrating an example of detailedprocessing in a light amount adjustment process;

FIG. 7 is a diagram conceptually explaining a method of detecting edgesof a print sheet;

FIG. 8 is a diagram conceptually explaining changes in sensor outputvalue in response to changes in ambient light; and

FIG. 9 is a diagram illustrating a flowchart for making a determinationon whether an effect of ambient light is present.

DESCRIPTION OF THE EMBODIMENTS

A printing apparatus according to an embodiment of the present inventionwill be described below with reference to the drawings. It should benoted that the following embodiment does not limit the present inventionand that not all of the combinations of the features described in thepresent embodiment are necessarily essential for the solution providedby the present invention. Also, in this embodiment, an inkjet printingapparatus will be described as an example of the printing apparatus.

<Internal Configuration of Printing Apparatus>

FIG. 1 is a diagram of an internal configuration of an inkjet printingapparatus 100 (hereinafter the printing apparatus 100). The printingapparatus 100 includes an automatic feed unit 101, a conveyance unit103, and a recovery unit 108.

The automatic feed unit 101 automatically feeds print media such asprint sheets into the main body of the apparatus. The conveyance unit103 guides each print medium individually fed from the automatic feedunit 101 to a predetermined printing position and further guides theprint medium from the printing position to a discharge unit 102. Therecovery unit 108 performs a recovery process on a printing unit thatperforms desired printing on a print medium conveyed to the printingposition. The printing unit includes a carriage 105 supported on acarriage shaft 104 so as to be movable in a main scanning directionindicated by the arrow X, and a print head 10 (see FIG. 2) detachablymounted on the carriage 105. The main scanning direction is a directioncrossing the conveyance direction in which a print medium is conveyed.

The carriage 105 is provided with a carriage cover 106 and a head setlever 107 that engage with the carriage 105 to guide the print head to apredetermined mount position on the carriage 105. The head set lever 107engages with a tank holder 113 of the print head 10 to set the printhead 10 in the predetermined mount position. At an upper portion of thecarriage 105, a head set plate (not illustrated) that is biased by aspring toward a portion to be engaged with the print head 10 is providedso as to be pivotable about a head set level shaft. The head set lever107 is configured to mount the print head 10 on the carriage 105 whilepressing the print head 10 with this spring force. Though notillustrated in FIG. 1, the carriage 105 is equipped with a sheet edgedetection sensor 401 (described with reference to FIG. 4 to be mentionedlater). The sheet edge detection sensor 401 is a sensor that measuresthe level of light reflection from a sheet to detect the positions ofedges of the sheet.

FIG. 2 is a diagram illustrating a configuration of the print head 10applicable to this embodiment. The print head 10 is a side shooter-typeprint head that ejects droplets in a direction substantiallyperpendicular to a heater substrate. The print head 10 is configured ofa printing element unit 111, an ink supply unit 112, and the tank holder113. The printing element unit 111 is configured of a first printingelement 114, a second printing element 115, a first plate 116, anelectric contact substrate 119, and a second plate 117.

The first plate 116, whose flatness accuracy affects the ejectiondirection of droplets and is therefore required to be high, is made ofan alumina (Al₂O₃) material with a thickness of 0.5 to 10 mm. The secondplate 117 is a single plate-shaped member with a thickness of 0.5 to 1mm and is laid on and fixed to the first plate 116 with a bondingadhesive therebetween. The first printing element 114 and the secondprinting element 115 are bonded to a surface of the first plate 116.

<Control Configuration of Printing Apparatus>

FIG. 3 is a diagram illustrating a block configuration of a controlsystem in the printing apparatus 100. A CPU 301 is capable of accessinga flash ROM 303 storing an updatable control program or processingprogram and an EEPROM 304 storing various pieces of constant data andthe like. The CPU 301 is also capable of accessing a RAM 302 for storingcommand signals and image information received from a host PC (notillustrated) via a USB control unit 316 and a network control unit 317.The CPU 301 controls a printing operation based on the pieces ofinformation stored in these memories and detection results from varioussensors that are connected to an input-output port 305 and detect statesof the printing apparatus.

The CPU 301 moves the carriage 105 by operating a carriage motor 309 viathe input-output port 305 and a carriage motor control circuit 307. TheCPU 301 also operates a sheet conveyance mechanism 310, such as aconveyance roller, by operating a sheet feed motor 308 via theinput-output port 305 and a sheet conveyance motor control circuit 306.The CPU 301 further drives the print head 10 by controlling a bandmemory control block 312 and a print head control block 314 based onpieces of information stored in the RAM 302. In this way, a desiredimage can be printed on a print medium. The band memory control block312 controls read, write, etc. of a memory 313 to be used in printing animage on a band-by-band basis by using the print head 10. Instructioninformation inputted via keys on an operation panel 319 is transferredto the CPU 301 via an operation panel control unit 318. Similarly, theON/OFF of LEDs in the operation panel 319 and the display of an LCD inthe operation panel 319 are controlled via the operation panel controlunit 318 in accordance with a command from the CPU 301.

An LED driving circuit 323 performs an operation of turning on or off anLED 325 incorporated in the sheet edge detection sensor 401 inaccordance with a command from the CPU 301. The LED driving circuit 323is also capable of controlling the amount of current to be supplied tothe LED 325 in accordance with a command from the CPU 301. In otherwords, the LED driving circuit 323 is an emitted light amount controlunit that controls the amount of light to be emitted from the LED 325.An I-V conversion circuit 322 converts a current output from thephototransistor 324, which varies according to the intensity of lightreceived by the phototransistor 324, into a voltage. An amplificationcircuit 321 serves to amplify the output of the phototransistor 324converted into a voltage value to an optimal voltage level forperforming A-D conversion. In other words, the amplification circuit 321is a received light amount amplification unit that amplifies the amountof light received by the phototransistor 324. An A-D conversion circuit320 converts the amplified output of the phototransistor 324 (the outputof the amplification circuit 321) into a 10-bit digital signal. The gainlevel of the amplification circuit 321 is adjustable. The CPU 301 iscapable of monitoring the level of the output voltage from theamplification circuit and making an adjustment on the gain or the amountof current to be supplied to the LED so as to obtain an optimal voltagelevel (hereinafter referred to as “light amount adjustment”).

It has been a common practice to integrate a CPU and its peripheralcircuits into a system-on-a-chip (SoC) for purposes such as saving thecost, reducing the power consumption, and increasing the speed. In theconfiguration in this embodiment, the CPU 301, the USB control unit 316,the band memory control block 312, and the input-output port 305 areintegrated into a single IC as an SoC.

<Configuration of Sheet Edge Detection Sensor>

FIG. 4 is a side view for explaining an arrangement of optical elementsof the sheet edge detection sensor 401. The sheet edge detection sensor401 is provided at one end of the carriage 105 in the main scanningdirection. The sheet edge detection sensor 401 in this example isconfigured of a single light emitting element and a single lightreceiving element. The light receiving element is the phototransistor324. The light emitting element is the visible light LED 325. Thephototransistor 324 is disposed so as to receive light from the LED 325diffusely reflected at an angle of 45 degrees. The light receivingregion of the phototransistor 324 is adjusted by an opening formed by acover member of the sheet edge detection sensor 401 and is configured toreceive a light beam of an approximately 2 mm square at a position abovea print sheet 402. The light emitting region of the LED 325 is optimizedto be larger than the light receiving region of the phototransistor 324.The sheet edge detection sensor 401 is located upstream of the printhead 10 in the conveyance direction of the print sheet 402 (Ydirection). The reason for this is to be able to detect an edge of thesheet at a non-printing region in a case of performing sheet edgedetection during printing. In other words, the reason is that at aprinting region the amount of reflected light is smaller, therebylowering the detection sensitivity.

<Processing in Borderless Printing>

The printing apparatus 100 in this embodiment is configured to becapable of detecting sheet edges by means of the sheet edge detectionsensor 401 in a case of printing a borderless image. The reason is toreduce the amount of ink consumption in the borderless printing andlengthen the life of a waste ink collection mechanism. Also, inconsideration of the variation in sensor characteristics, the variationin attachment position, and the like, a light amount adjustment processis performed on the sheet edge detection sensor 401. In this embodiment,in the light amount adjustment process, the presence of an effect ofambient light is determined, and the sheet edge detection using thesheet edge detection sensor 401 is not performed in a case where aneffect of ambient light is present. On the other hand, in a case whereno effect of ambient light is present, the sheet edge detection usingthe sheet edge detection sensor 401 is performed while printing isperformed with the print head 10. Then, the printing start position andthe printing end position are set at appropriate positions according tothe detection result. In this way, borderless printing is executed withthe extra-printing amount minimized.

FIG. 5 is a diagram illustrating an example flowchart of processing inborderless printing in this embodiment. The flowchart of FIG. 5 includesa light amount adjustment process executed before the printing and sheetedge detection, and an ambient light determination process. In thisexample, the ambient light determination process of determining thepresence of an effect of ambient light is performed after the lightamount adjustment process is performed. Specifically, the ambient lightdetermination process is performed after the light amount adjustmentprocess is performed but before the sheet edge detection process isperformed. The CPU 301 implements the flowchart of FIG. 5 by executingthe program stored in the flash memory 303, for example. In other words,the processing in FIG. 5 is performed via control by the CPU 301.Meanwhile, the symbol “S” in the description of each process means astep in the flowchart (the same applies below herein).

The processing in FIG. 5 is performed in a case where the printingapparatus 100 receives print data (print job) on a borderless image fromthe host PC. A description will be given here using an example in whicha print job is received from the host PC. Alternatively, the processingillustrated in FIG. 5 may be performed in a case where the CPU 301receives a print job stored in the RAM 302 or the like. Incidentally,the printing apparatus 100 is capable of selecting whether or not toexecute the light amount adjustment process based on a user setting, andthe processing illustrated in FIG. 5 is performed in a case where thelight amount adjustment process has been set to be executed by the user.

In a case where the printing apparatus 100 receives print data on aborderless image from the host PC, then in S501, the sheet conveyancemotor control circuit 306 conveys a print sheet 402 to a light amountadjustment position for the light amount adjustment of the sheet edgedetection sensor 401. After the completion of the conveyance of thesheet, then in S502, the carriage motor control circuit 307 moves thecarriage 105 so that the sheet edge detection sensor 401 can reach thelight amount adjustment position above the conveyed print sheet 402.Incidentally, S501 and S502 may be performed in in reverse order or inparallel.

After the completion of movement of the print sheet 402 and the carriage105 to the light amount adjustment position, then in S503, the CPU 301performs the light amount adjustment process. In the light amountadjustment process, the amount of light is adjusted such that the levelof the voltage outputted from the amplification circuit 321 connected tothe phototransistor 324 being a light receiving unit (hereinafterreferred to as the light reception level) becomes an optimal voltagelevel. This adjustment of the amount of light includes at least one ofan adjustment of the gain level of the amplification circuit 321 and anadjustment of the amount of current to be supplied to the LED 325 beinga light emitting unit. A detailed adjustment method will be describedlater.

After the light amount adjustment process in S503, the CPU 301determines in S504 whether the light amount adjustment in S503 hassucceeded. The CPU 301 proceeds to S505 if the light amount adjustmenthas succeeded, and proceeds to S512 if the light amount adjustment hasnot succeeded.

In S505, the CPU 301 obtains the light reception level above the printsheet 402 stored in the RAM 302 after the completion of the light amountadjustment. Then in S506, the CPU 301 performs the ambient lightdetermination process. In the ambient light determination process, thepresence of an effect of ambient light is determined by comparing thelight reception level (the output from the amplification circuit 321)obtained in S505 and the light reception level in a state where the LED325 of the sheet edge detection sensor 401 is turned off. Though detailsof the ambient light determination method will be described, the ambientlight determination is performed after the light amount adjustment inthis embodiment. The reason is that the presence of an effect of ambientlight cannot be properly determined without properly adjusting the lightreception level in the state where the LED 325 is turned on and thenobtaining the light reception level in a turned-off state with the samesetting as that for the adjustment in the turned-on state. As a resultof the ambient light determination process in S506, whether an effect ofambient light is present is determined.

In S507, the CPU 301 determines whether an effect of ambient light ispresent. If no effect of ambient light is present, the CPU 301 proceedsto S508. If, on the other hand, an effect of ambient light is present,the CPU 301 proceeds to S512. In S512, the CPU 301 sets a setting to notperform sheet edge detection during the printing. Specifically, the CPU301 sets a setting to perform borderless printing with a predeterminedextra-printing amount. S512 is a process performed in the case where aneffect of ambient light is present or the light amount adjustmentprocess has failed. In these cases, there is a possibility that thesheet edge detection process cannot be performed during the printing orthe accuracy of the sheet edge detection process has dropped. Printingthe desired image is more in line with the user need than reducing theamount of ink consumption during the borderless printing and lengtheningthe life of the waste ink collection mechanism. Thus, in order to printthe desired image, a predetermined extra-printing amount (in thisexample, a preset largest extra-printing amount) is set.

In the case where no effect of ambient light is present, control isperformed so as to perform sheet edge detection during the printing. InS508, the carriage motor control circuit 307 moves the carriage 105 suchthat the sheet edge detection sensor 401 is located at a predeterminedposition outside the print sheet. In S509, the CPU 301 turns on the LED325 and obtains the light reception level outside the print sheet 402.In S510, the CPU 301 determines a threshold value for the sheet edgedetection based on the light reception level above the print sheet 402obtained in S505 and the light reception level outside the sheetobtained in S509. In this example, the threshold value is the medianvalue between the light reception level above the sheet obtained in S505and the light reception level outside the sheet obtained in S509. Notethat the threshold value is not limited to this example. It only needsto be a value between the light reception level obtained in S505 and thelight reception level obtained in S509, and is preferably the medianvalue between them. In S511, the CPU 301 sets a setting to perform thesheet edge detection during the printing by using the threshold valuedetermined in S510.

In S513, the CPU 301 performs printing in accordance with the settingset in S511 or S512.

<Light Amount Adjustment>

FIGS. 6A and 6B are flowcharts illustrating an example of detailedprocessing in the light amount adjustment process in S503. The lightamount adjustment is performed in order to correct the variation of thelight emitting unit and the light receiving unit of the sheet edgedetection sensor 401, the variation in the accuracy of the attachmentposition, the variation in the reflectivity of the print sheet, and soon and thereby perform stable sheet edge position detection. The CPU 301performs the light amount adjustment process in FIGS. 6A and 6B bycontrolling the LED driving circuit 323 or the amplification circuit321. Note that each numerical value described in FIGS. 6A and 6B is amere example and is not limited to this example.

Firstly, the CPU 301 initializes a gain setting value G of theamplification circuit 321 connected to the phototransistor 324 to ×25.1and initializes an LED driving current value I_(F) of the LED drivingcircuit 323 to 10 mA (S601). The amplification circuit 321 in thisembodiment is capable of setting a gain setting value G of ×0.1 to ×99.7with an 8-bit digital signal (i.e., 1 LSB=×0.39). Also, the LED drivingcircuit 323 in this embodiment is capable of setting the driving currentvalue IF in a stepwise manner by selecting a value from among 1 mA, 2mA, 5 mA, 10 mA, 20 mA, and 30 mA.

After completing the initialization of the gain setting value G and thedriving current value IF, the CPU 301 obtains a light reception levelA_Med above the sheet (S602). The CPU 301 compares the light receptionlevel A_Med and a reference voltage Sta with each other (S603). Theadjustment is done if the light reception level A_Med and the referencevoltage Sta are equal.

If the light reception level A_Med is lower (darker) than the referencevoltage Sta in S603, the CPU 301 raises the gain setting value G by onestep (S604) and obtains the light reception level A_Med (S605). Thereference voltage Sta in this embodiment is 2.6 V. Then, the CPU 301checks the gain setting value G (S606) and, if the gain setting value Gis outside a predetermined range (in this example, outside a range of×2.4 to ×87.6), performs an adjustment of the driving current valueI_(F) to be described later. In the case where the gain setting value Gis outside such a predetermined range, a sufficient adjustment cannot bemade by adjusting the gain setting value G. The adjustment of thedriving current value IF is therefore performed. If, on the other hand,the gain setting value G is in the predetermined range (in this example,in the range of ×2.4 to ×87.6), the CPU 301 compares the light receptionlevel A_Med and the reference voltage Sta with each other (S607). Then,if the light reception level A_Med is higher than or equal to thereference voltage Sta, the adjustment is done. If, on the other hand,the light reception level A_Med is lower than the reference voltage Sta,the CPU 301 returns to S604 and repeats the adjustment.

If the light reception level A_Med is higher (lighter) than thereference voltage Sta in S603, the CPU 301 lowers the gain setting valueG by one step (S608) and obtains the light reception level A_Med (S609).Then, the CPU 301 checks the gain setting value G (S610) and, if thegain setting value G is outside the predetermined range (outside therange of ×2.4 to ×87.6), performs the adjustment of the driving currentvalue I_(F). If the gain setting value G is in the predetermined range(in the range of ×2.4 to ×87.6), the CPU 301 compares the lightreception level A_Med and the reference voltage Sta with each other(S611). Then, if the light reception level A_Med is lower than or equalto the reference voltage Sta, the adjustment is done. If the lightreception level A_Med is higher than the reference voltage Sta, the CPU301 returns to S608 and repeats the adjustment.

If the result of the check of the gain setting value G in S606 or S610indicates that the gain setting value is outside the predetermined range(outside the range of ×2.4 to ×87.6), the CPU 301 proceeds to S651 toset the driving current value I_(F).

In S651, the CPU 301 checks the gain setting value G and, if the gainsetting value G is ×2.4 or lower, proceeds to S652, in which the CPU 301checks the currently set driving current value IF. If the drivingcurrent value IF is set at 1 mA, which is the lowest settable value, thelight reception level cannot be lowered any further. The CPU 301therefore proceeds to S658, in which the adjustment is terminated as afailure. In the case where the adjustment fails, the printing will beperformed with the largest extra-printing amount without performingsheet edge detection during the printing (No in S504 in FIG. 5 and theCPU 301 proceeds to S512). If the currently set driving current valueI_(F) is not 1 mA, the CPU 301 lowers the current value setting by onestep in S653, and then sets the driving current value IF for the LEDdriving circuit 323 (S654).

If, on the other hand, the result of the check of the gain setting valueG in S651 indicates that the gain setting value G is set at ×87.6 orhigher, the CPU 301 proceeds to S656, in which it checks the currentlyset driving current value IF. If the driving current value IF is set at30 mA, which is the highest settable value, the light reception levelcannot be raised any further. The CPU 301 therefore proceeds to S658, inwhich the adjustment is terminated as a failure. In the case where theadjustment fails, the printing will be performed with the largestextra-printing amount without performing sheet edge detection during theprinting. If the currently set driving current value IF is not 30 mA,the CPU 301 raises the current value setting by one step in S657, andthen sets the driving current value IF for the LED driving circuit 323(S654).

After setting the driving current value I_(F) in S654, the CPU 301initializes the gain setting value G to ×25.1 and returns to S602 tocontinue the light amount adjustment. The above is the description ofthe light amount adjustment process.

<Sheet Edge Detection and Effect of Ambient Light>

FIG. 7 is a diagram conceptually explaining a method of detecting edgesof a print sheet 402 being a print medium. In FIG. 7, the sheet edgedetection sensor 401 is provided on the right side of the carriage 105with respect to the sheet surface (−X direction side). Also, FIG. 7illustrates the position of the carriage 105 in the main scanningdirection (CR position) and the light reception level of light receivedby the sheet edge detection sensor 401 at the CR position.

The LED 325 of the sheet edge detection sensor 401 is turned on and thecarriage 105 is moved from above the print sheet 402 to an edge of theprint sheet 402. Then, when the center of the light receiving region ofthe sheet edge detection sensor 401 crosses the position of a sheet edge702, the output of the sensor becomes ½ of the sum of the lightreception level above the print sheet 402 and the light reception levelabove a platen 701, which is outside the print sheet. Thus, the CPU 301determines and stores ½ of the sum of the light reception level abovethe print sheet and the light reception level outside the print sheet asa threshold value (S510), and sets the carriage position at which thisvalue is crossed as a print sheet edge. Note that the light receptionlevel above the print sheet used to determine the threshold value is avalue after the adjustment in the light amount adjustment explained inFIGS. 6A and 6B. Ideally, the threshold value thus set is used to detectedges of the print sheet 402 to determine proper edge positions of theprint sheet. However, during the light amount adjustment, ambient lightmay get in through a sheet discharge port or the like and the lightreceiving unit of the sheet edge detection sensor 401 may receive theambient light as well as the light from the light emitting unit.Specifically, the amount of ambient light may be different between whenthe light amount adjustment is performed and when a printing operationis performed with sheet edge detection. This may deteriorate theaccuracy of the sheet edge detection. Consequently, the printing startposition and the printing end position at the sheet edges may beshifted, thereby deteriorating the image quality. This will be describedbelow using FIG. 8.

FIG. 8 is a diagram conceptually explaining changes in sensor outputvalue (light reception level) in response to changes in ambient lightafter performing the light amount adjustment and determining thethreshold value. A sensor output a is a sensor output in a case wherethe ambient light is the same in the light amount adjustment and thesheet edge detection, and is equivalent to the sensor output illustratedin FIG. 7.

A sensor output b is a sensor output in a case where the level of theambient light becomes lower than in the light amount adjustment afterperforming the light amount adjustment and determining the thresholdvalue. In this case, the light reception level in the sheet edgedetection is lower. The threshold value has been determined before thelevel of the ambient light becomes lower. For this reason, the sensoroutput crosses the threshold value at a position on the inside of thesheet from the actual sheet edge 702, as illustrated in FIG. 8.Accordingly, the printing start position setting and the printing endposition setting shift to the inside of the sheet.

A sensor output c is a sensor output in a case where the level of theambient light becomes higher than in the light amount adjustment afterperforming the light amount adjustment and determining the thresholdvalue. In the case of the sensor output c, the light reception level inthe sheet edge detection is higher. For this reason, the sensor outputcrosses the threshold value at a position on the outside of the sheetfrom the actual sheet edge 702, as illustrated in FIG. 8. Accordingly,the printing start position setting and the printing end positionsetting shift to the outside of the sheet.

Here, the extra-printing amount increases in the case where the printingstart position and the printing end position shift to the outside fromthe actual sheet edges. That is, although sheet edge detection isperformed, the amount of ink consumption and the like cannot be reduced.Nonetheless, borderless printing itself is still performed on the printsheet 402, and therefore the effect on the image is low. On the otherhand, the shift of the printing start position and the printing endposition to the inside from the actual sheet edges results in formationof a border despite the intention to print a borderless image. Thus, thedesired image is not printed. The effect on the image is therefore high.In view of the above, in this embodiment, it is determined that aneffect of ambient light is present in a case where the effect of theambient light on the image is high, and borderless printing is performedwith a predetermined extra-printing amount.

Specifically, a process is performed in which it is determined whetherthe positions of the sheet edges to be detected have a possibility ofshifting to the inside from the actual sheet edges in a case ofperforming the sheet edge detection process in a state where the amountof the incoming ambient light is smaller than that at the point when thelight amount adjustment was performed. If there is a possibility ofshift to the inside, it is determined that an effect of ambient light ispresent, and borderless printing is performed with the predeterminedextra-printing amount.

<Ambient Light Determination Process>

Next, the process of determining whether an effect of ambient light ispresent will be described. The effect of ambient light can be evaluatedby using the light reception level in a state where the LED 325 isturned off and the light reception level in a state where the LED 325 isturned on. Note that the above light reception level in the state wherethe LED 325 is turned on is the light reception level after the lightamount adjustment. Specifically, it is the light reception levelobtained in the light amount adjustment performed with the LED 325turned on to obtain an appropriate light reception level above thesheet.

In a case where the amount of the incoming ambient light in the lightamount adjustment is greater than a predetermined amount, the lightreception level is a value greater than a predetermined level even withthe LED 325 turned off. In the case where the amount of the incomingambient light is greater than the predetermined amount, the drivingcurrent value of the LED 325 or the gain setting value G of theamplification circuit 321 is set by the light amount adjustment at alower value than that in a case where the amount of the incoming ambientlight is less than the predetermined amount. Thus, the light receptionlevel remains at a relatively large value even with the LED 325 turnedoff. In other words, the amount of the incoming ambient light in thelight amount adjustment is greater than the predetermined amount if thelight reception level in the state where the LED 325 is turned off tothe light reception level in the state where the LED 325 is turned on isa certain value or greater. In this case, if the amount of the incomingambient light decreases while borderless printing is performed withsheet edge detection, the printing start position and the printing endposition will shift to the inside from the actual sheet edges, asmentioned earlier.

Now, suppose a case where the driving current value of the LED 325obtained as a result of the light amount adjustment is greater than apredetermined value. In such a case, the driving current value of theLED 325 is assumed to have been set to be greater than the predeterminedvalue due to the amount of the incoming ambient light being relativelysmall in the light amount adjustment. Then, even if the amount of theincoming ambient light in the light amount adjustment further decreaseswhile the subsequent borderless printing is performed, the effect on theimage is low since the degree of effect in the light amount adjustmentis low. Also, even if the amount of the incoming ambient light in thelight amount adjustment increases while the subsequent borderlessprinting is performed, the printing start position and the printing endposition shift to the outside from the actual sheet edges, which merelyincreases the extra-printing amount. That is, the effect on the image islow.

In view of the above, in this embodiment, the value of P_(OFF)/P_(ON) iscalculated, where P_(ON) is the light reception level in the state wherethe LED 325 is turned on, and P_(OFF) is the light reception level inthe state where the LED 325 is turned off. Then, the CPU 301 determinesthat an effect of ambient light is present if P_(OFF)/P_(ON) is greaterthan a certain value, and determines that no effect of ambient light ispresent if P_(OFF)/P_(ON) is the certain value or less.

FIG. 9 is a diagram illustrating a flowchart for making a determinationon whether an effect of ambient light is present, which is made in S506.

The CPU 301 turns on the LED 325 of the sheet edge detection sensor 401(S901). The CPU 301 then obtains the light reception level P_(ON) in thestate where the LED 325 is turned on (S902). Incidentally, the CPU 301may obtain the light reception level after the light amount adjustmentobtained in S505. Thereafter, the CPU 301 turns off the LED 325 of thesheet edge detection sensor 401 (S903). The CPU 301 then obtains thelight reception level Pond in the state where the LED 325 is turned off(S904).

Thereafter, the CPU 301 compares the value of P_(OFF)/P_(ON) and anambient light determination threshold value (the above-mentioned certainvalue) with each other. In a case where the value of P_(OFF)/P_(ON) isgreater than the ambient light determination threshold value, the CPU301 determines that there will an effect on the image if the amount ofthe incoming ambient light decreases. In this case, the CPU 301 sets asetting to perform printing with the largest extra-printing amountwithout performing sheet edge detection during the printing (see S512).On the other hand, in a case where the value of P_(OFF)/P_(ON) is theambient light determination threshold value or less, the CPU 301determines that there will not be an effect on the image even if theamount of the incoming ambient light decreases. In this case, the CPU301 sets a setting to perform printing with the smallest extra-printingamount while performing sheet edge detection during the printing (seeS511). Note that the user can set the largest extra-printing amount andthe smallest extra-printing amount on the operation panel 319. Also, theambient light determination threshold value is a different thresholdvalue from the threshold value for sheet edge detection describedearlier.

<Sheet Edge Detection Process>

Next, the sheet edge detection process performed in the case where thesetting to perform sheet edge detection during the printing is set inS511 will be described with reference to FIG. 7 again. Basically, in thesheet edge detection process, a process of detecting sheet edges withthe sheet edge detection sensor 401 is performed in each scan. Then, theprinting start position and the printing end position obtained as aresult of the detection will be used in the scan following the scan inwhich the detection is performed. Also, as mentioned earlier, sheet edgedetection is performed during a movement of the carriage 105 from abovethe sheet to the outside of the sheet. Specifically, in the example ofFIG. 7, detection is performed during a movement of the carriage 105from above the sheet to the right side of the sheet surface (right edgedetection) and also detection is performed during a movement of thecarriage 105 from above the sheet to the left side of the sheet surface(left edge detection) are performed. The reason is that the detectionaccuracy of the detection value is higher in a case of detecting thechange from above the sheet, on which the detection value is stable.Incidentally, in the initial scan or depending on the sheet size, it maybe impossible to detect the printing start position on one side. In thiscase, the corresponding portion is subjected to borderless printing withthe largest extra-printing amount.

As described above, the printing apparatus according to the embodimentof the present invention performs the ambient light determinationprocess after the light amount adjustment of the sheet edge detectionsensor 401 in a case of performing a printing operation based on printdata (print job) on borderless printing. In the ambient lightdetermination process, it is determined whether there will be an effecton the image if the amount of the incoming ambient light decreases afterperforming the light amount adjustment and determining the thresholdvalue. In the case where it is determined that there will be an effecton the image if the amount of the incoming ambient light decreases, theextra-printing amount in the borderless printing is set at apredetermined amount (e.g., the largest amount) and the printing isperformed. In this way, it is possible to reduce the effect on the imageand print the desired image.

Other Embodiments

In the above embodiment, an example has been described in which thelight amount adjustment process and the ambient light determinationprocess are performed in a case where print data (print job) as aninstruction to perform borderless printing is received. Here, in a casewhere a print job containing a plurality of pages to print a borderlessimage is received, the light amount adjustment process and the ambientlight determination process may be performed prior to the printing ofthe first page, and the light amount adjustment process, etc. do nothave to be performed again for the printing of the subsequent pages.This is to shorten the printing time.

In the above embodiment, an example has been described in which thepresence of an effect of ambient light is determined based on the lightreception level above the print sheet 402 in the state where the LED 325is turned on and the light reception level above the print sheet 402 inthe state where the LED 325 is turned off. Further, the light receptionlevel outside the print sheet in the state where the LED 325 is turnedon and the light reception level outside the print sheet in the statewhere the LED 325 is turned off may be additionally obtained. The reasonis that the threshold value for sheet edge detection is calculated fromthe light reception level above the sheet and the light reception leveloutside the sheet. Thus, it may be determined that an effect of ambientlight is present in a case where the ratio of the light reception leveloutside the sheet in the state where the LED 325 is turned off to thelight reception level outside the sheet in the state where the LED 325is turned on is above a predetermined value, even if the ratio betweenthe light reception levels above the sheet is not above the ambientlight determination threshold value. Thus, the error in edge detectionin a case where the amount of ambient light decreases can be accuratelyfigured out by using the light reception levels above the sheet in thestate where the LED 325 is turned on and in the state where the LED 325is turned off and the light reception levels outside the sheet in thestate where the LED 325 is turned on and in the state where the LED 325is turned off.

Also, in the above embodiment, an example has been described in whichborderless printing is executed with the largest extra-printing amountwithout executing sheet edge detection during the printing in a casewhere it is determined that an effect of ambient light is present.However, the extra-printing amount may be varied according to the degreeof effect of the ambient light. Specifically, a smaller extra-printingamount than the largest extra-printing amount may be set in a case wherethe effect of the ambient light is relatively low.

Also, in the above embodiment, an example has been described in whichthe print head 10 is mounted on the carriage 105, and sheet edges aredetected with the sheet edge detection sensor 401 while the print head10 is scanned to print an image. However, the present invention is notlimited to this example. A printing apparatus using a so-calledline-type print head 10 in which ejection openings are disposed toextend in the width direction of a print sheet may be equipped with acarriage for sheet edge detection and detect sheet edges in a similarmanner to the above embodiment.

Also, in the above embodiment, an example has been described in whichdetection with the sheet edge detection sensor 401 is not performed in acase of executing borderless printing with the largest extra-printingamount. Specifically, the carriage 105 is scanned without causing theLED 325 to emit light in the case of executing borderless printing withthe largest extra-printing amount. However, the present invention is notlimited to this example. A configuration may be employed in which theLED 325 is caused to emit light in the case of executing borderlessprinting with the largest extra-printing amount and the level of thereceived light is not used to perform a sheet edge detection process.

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all such modifications and equivalent structures andfunctions.

This application claims the benefit of Japanese Patent Application No.2020-026146, filed Feb. 19, 2020, which is hereby incorporated byreference wherein in its entirety.

What is claimed is:
 1. A printing apparatus comprising: a carriageconfigured to move in a direction crossing a conveyance direction of aprint sheet; a detection unit disposed on the carriage and having alight emitting unit for emitting light and a light receiving unit formaking an output according to received light, the detection unit beingconfigured to detect a sheet edge of the print sheet based on the outputfrom the light receiving unit when the light emitting unit emits lightto the print sheet; an adjustment unit configured to adjust at least oneof an amount of light to be emitted from the light emitting unit and theoutput from the light receiving unit such that the output from the lightreceiving unit when the light emitting unit emits light to apredetermined position on the print sheet is at a predetermined level;and a control unit configured to control an extra-printing amount bywhich printing extends off the sheet edge, after the adjustment by theadjustment unit but before the detection of the sheet edge by thedetection unit, based on the output from the light receiving unit. 2.The printing apparatus according to claim 1, wherein the control unitdetermines whether an effect of ambient light is present based on theoutput.
 3. The printing apparatus according to claim 2, wherein thecontrol unit sets a predetermined extra-printing amount as theextra-printing amount from the sheet edge in a case where the controlunit determines that the effect of ambient light is present.
 4. Theprinting apparatus according to claim 3, wherein the predeterminedextra-printing amount has been set by a user in advance.
 5. The printingapparatus according to claim 2, wherein the control unit does notexecute the detection by the detection unit in a case where the controlunit determines that the effect of ambient light is present.
 6. Theprinting apparatus according to claim 2, wherein the control unit setsthe extra-printing amount from the sheet edge without using a resultdetected by the detection unit in a case where the control unitdetermines that the effect of ambient light is present.
 7. The printingapparatus according to claim 2, wherein the control unit sets theextra-printing amount from the sheet edge based on a position of thesheet edge detected by the detection unit in a case where the controlunit determines that the effect of ambient light is not present.
 8. Theprinting apparatus according to claim 2, wherein the determining ofwhether the effect of ambient light is present includes determiningwhether a position of the sheet edge to be detected by the detectionunit has a possibility of shifting to an inside of the print sheet in acase where the detection unit detects the sheet edge in a state where anamount of incoming ambient light has decreased from that at a point whenthe amount of light was adjusted by the adjustment unit.
 9. The printingapparatus according to claim 2, wherein the control unit determineswhether the effect of ambient light is present by using an output fromthe light receiving unit when the light emitting unit emits light and anoutput from the light receiving unit when the light emitting unit doesnot emit light.
 10. The printing apparatus according to claim 9, whereinthe control unit determines that the effect of ambient light is presentin a case where a ratio of the output from the light receiving unit whenthe light emitting unit does not emit light to the output from the lightreceiving unit when the light emitting unit emits light is greater thana predetermined threshold value.
 11. The printing apparatus according toclaim 10, wherein in the determination of whether the effect of ambientlight is present, the light emitting unit is caused to emit light andnot to emit light above the print sheet.
 12. The printing apparatusaccording to claim 10, wherein in the determination of whether theeffect of ambient light is present, the light emitting unit is caused toemit light and not to emit light outside the print sheet.
 13. Theprinting apparatus according to claim 2, wherein the detection unitfurther includes: an emitted light amount control unit configured tocontrol the amount of light to be emitted from the light emitting unit;and a received light amount amplification unit configured to amplify anamount of light received with the light receiving unit, and theadjustment unit performs the adjustment by controlling at least one ofthe emitted light amount control unit and the received light amountamplification unit.
 14. The printing apparatus according to claim 1,wherein the adjustment unit performs the adjustment in a case where aprint job as an instruction to perform borderless printing is obtained.15. The printing apparatus according to claim 14, wherein in a casewhere data on the borderless printing indicates execution of printing ofa plurality of pages, the adjustment unit performs the adjustment beforethe printing of a first page is performed, and does not perform theadjustment before the printing of a page following the first page.
 16. Amethod of controlling a printing apparatus including a carriageconfigured to move in a direction crossing a conveyance direction of aprint sheet, and a detection unit disposed on the carriage and having alight emitting unit for emitting light and a light receiving unit formaking an output according to received light, the detection unit beingconfigured to detect a sheet edge of the print sheet based on the outputfrom the light receiving unit when the light emitting unit emits lightto the print sheet, the method comprising: adjusting at least one of anamount of light to be emitted from the light emitting unit and theoutput from the light receiving unit such that the output from the lightreceiving unit when the light emitting unit emits light to apredetermined position on the print sheet is at a predetermined level;and controlling an extra-printing amount by which printing extends offthe sheet edge, after the adjustment in the adjusting but before thedetection of the sheet edge by the detection unit, based on the outputfrom the light receiving unit.